TESTER = unittest
TESTOBJS = run.o AttrMapTest.o XMLTokenTest.o TokenizerTest.o \
	SAX_ParserTest.o DocumentTest.o ElementTest.o AttributeTest.o \
	TextTest.o CommentTest.o DOM_ParserTest.o FunctionsTest.o \
	NodeListTest.o DOM_ParserWithNSTest.o KnownBug.o XPathTest.o \
	EncodingResolverTest.o

LDFLAGS = -g 
LDADD = `cppunit-config --libs`
CXXFLAGS = -c -g  -ansi `cppunit-config --cflags`

SAX_PARSER = ../src/MiX/SAX_Parser.h ../src/MiX/SAX_Parser.cpp \
	../src/MiX/SAX_EventHandler.h ../src/MiX/SAX_EventHandler.cpp
DOM_PARSER = ../src/MiX/DOM_Parser.h ../src/MiX/DOM_Parser.cpp
DOM_BASE = ../src/MiX/Node.h ../src/MiX/NodeContainer.h \
	../src/MiX/NamedNode.h 	 ../src/MiX/Value.h \
	../src/MiX/NodeContainer.cpp 
DOM_DOCUMENT = ../src/MiX/Document.h ../src/MiX/Document.cpp
DOM_ELEMENT = ../src/MiX/Element.h ../src/MiX/Element.cpp
DOM_ATTRIBUTE = ../src/MiX/Attribute.h ../src/MiX/Attribute.cpp
DOM_COMMENT = ../src/MiX/Comment.h 
DOM_TEXT = ../src/MiX/Text.h
XPATH = ../src/MiX/XPath.h ../src/MiX/XPath.cpp \
	../src/MiX/XPathAtom.h ../src/MiX/XPathAtom.cpp \
	../src/MiX/XPathParser.h ../src/MiX/XPathParser.cpp

DOM_OBJECT = $(DOM_BASE) $(DOM_DOCUMENT) $(DOM_ELEMENT) $(DOM_ATTRIBUTE) \
	$(DOM_COMMENT) $(DOM_TEXT)


all : $(TESTER)
$(TESTER) : $(TESTOBJS)
	$(CXX) -o $(TESTER) $(LDFLAGS) $(TESTOBJS) $(LDADD)

SAX_ParserTest.o : SAX_ParserTest.cpp $(SAX_PARSER)

DocumentTest.o : DocumentTest.cpp $(DOM_BASE) $(DOM_DOCUMENT)
ElementTest.o : ElementTest.cpp $(DOM_BASE) $(DOM_ELEMENT)
AttributeTest.o : AttributeTest.cpp $(DOM_BASE) $(DOM_ATTRIBUTE)
TextTest.o : TextTest.cpp $(DOM_BASE) $(DOM_TEXT)
CommentTest.o : CommentTest.cpp $(DOM_BASE) $(DOM_COMMENT)

DOM_ParserTest.o : DOM_ParserTest.cpp $(DOM_PARSER) $(DOM_OBJECT)
DOM_ParserWithNSTest.o : DOM_ParserWithNSTest.cpp $(DOM_PARSER) $(DOM_OBJECT)


.PHONY : clean
clean : 
	$(RM) *.o *~ $(TESTER)

%.o : %.cpp
	$(CXX) $(CXXFLAGS) $< -o $@
